package com.shushan.mixedexam.bean;

import com.android.net.bean.NetBaseBean;
import com.shushan.base.Constants;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @ClassName: ExerciseResultBean
 * @Desciption: 考试结果bean
 * @author: yichaohua
 * @date: 2018-04-20
 */
public class ExerciseResultBean extends NetBaseBean {

    public int id;
    public int chineseScore;
    public int mathScore;
    public int englishScore;
    public int score;
    public int reward_time;
    public String reward_name;
    public String reward_description;
    public int stars_num;//本次练习增加的学贝数
    public int error_count;//本次练习的错题数
    public String paper_id;
    public String first_toy;//是否有首次练习奖励：为空则有，否则无

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        if (jsonObject == null) {
            return;
        }
        id = jsonObject.optInt("id", 0);
        chineseScore = jsonObject.optInt(Constants.SUBJECT_CHINESE_ID + "", 0);
        mathScore = jsonObject.optInt(Constants.SUBJECT_MACH_ID + "", 0);
        englishScore = jsonObject.optInt(Constants.SUBJECT_ENGLISH_ID + "", 0);
        score = jsonObject.optInt("score", 0);
        reward_time = jsonObject.optInt("reward_time", 0);
        reward_name = jsonObject.optString("reward_name", "");
        reward_description = jsonObject.optString("reward_description", "");
        stars_num = jsonObject.optInt("stars_num", 0);
        error_count = jsonObject.optInt("error_count", 0);
        paper_id = jsonObject.optString("paper_id", "");
        first_toy = jsonObject.optString("first_toy", "");
    }

}
